﻿using DevExpress.XtraGrid.Demos.util;
using DXApplicationTangche.DTO;
using DXApplicationTangche.service;
using mendian;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DXApplicationTangche.UC.抖音出入库.Service
{
    public class 抖音Service
    {
        /// <summary>
        /// 客户地址一览
        /// </summary>
        /// <returns></returns>
        public static DouyinCustomerAddressDao getLatestCustomerAddressLog(String mobile)
        {
            return
                FunctionHelper.JsonDeserialization<DouyinCustomerAddressDao>(
                    RestCall.httpGetMethod(
                        URL.接口url1 + "/douyin/getLatestCustomerAddressLog?mobile=" + mobile
                    )
                );
        }
        /// <summary>
        /// 客户地址一览
        /// </summary>
        /// <returns></returns>
        public static List<DouyinCustomerAddressDao> getCustomerAddressLog(String mobile)
        {
            return
                FunctionHelper.JsonDeserialization<List<DouyinCustomerAddressDao>>(
                    RestCall.httpGetMethod(
                        URL.接口url1 + "/douyin/getCustomerAddressLog?mobile=" + mobile
                    )
                );
        }
        /// <summary>
        /// 保存抖音订单相关客户信息
        /// </summary>
        /// <param name="orgId"></param>
        /// <param name="shopId"></param>
        /// <param name="douyinOrderAddressDTO"></param>
        public static void saveDouyinUserInfo(String orgId, String shopId, DouyinCustomerAddressDTO douyinCustomerAddressDTO)
        {
            RestCall.PostHttp(
                URL.接口url1 + "/douyin/saveDouyinUserInfo?orgId=" + orgId + "&shopId=" + shopId,
                FunctionHelper.JsonSerialization(douyinCustomerAddressDTO)
            );
        }
        /// <summary>
        /// 抖音客户一览
        /// </summary>
        /// <returns></returns>
        public static List<DouyinAddressQueryDTO> getDouyinUserAddressInfoAll(String orgId, String shopId)
        {
            return
                FunctionHelper.JsonDeserialization<List<DouyinAddressQueryDTO>>(
                    RestCall.httpGetMethod(
                        URL.接口url1 + "/douyin/getDouyinUserAddressInfoAll?orgId=" + orgId + "&shopId=" + shopId
                    )
                );
        }
        /// <summary>
        /// 抖音物料一览
        /// </summary>
        /// <returns></returns>
        public static List<DouyinMaterialDTO> getDouyinMaterialAll()
        {
            return
                FunctionHelper.JsonDeserialization<List<DouyinMaterialDTO>>(
                    RestCall.httpGetMethod(
                        URL.接口url + "/douyin/getDouyinMaterialAll"
                    )
                );
        }
        /// <summary>
        /// 取抖音出库一览
        /// </summary>
        /// <returns></returns>
        public static List<DouyinStockOutDTO> getDouyinStockOutQueryAll()
        {
            return
                FunctionHelper.JsonDeserialization<List<DouyinStockOutDTO>>(
                    RestCall.httpGetMethod(
                        URL.接口url + "/douyin/getDouyinStockOutQueryAll"
                    )
                );
        }
        /// <summary>
        /// 保存抖音出库
        /// </summary>
        /// <param name="douyinRequestDTO"></param>
        public static void saveDouyinRequest(List<DouyinRequestDTO> douyinRequestDTO)
        {
            String xx = FunctionHelper.JsonSerialization(douyinRequestDTO);
            RestCall.PostHttp(
                URL.接口url + "/douyin/saveDouyinRequest",
                FunctionHelper.JsonSerialization(douyinRequestDTO)
                );
        }
        /// <summary>
        /// 创建抖音物料
        /// </summary>
        /// <param name="douyinRequestDTO"></param>
        public static void saveDouyinMaterial(DouyinMaterialDTO douyinMaterialDTO)
        {
            String xx = FunctionHelper.JsonSerialization(douyinMaterialDTO);
            RestCall.PostHttp(
                URL.接口url + "/douyin/saveDouyinMaterial",
                FunctionHelper.JsonSerialization(douyinMaterialDTO)
                );
        }
        public static List<RetailStockOutDTO> getRetailStockOutByBarcodes(List<String> barcodes)
        {
            String xx = FunctionHelper.JsonSerialization(barcodes);
            return
                FunctionHelper.JsonDeserialization<List<RetailStockOutDTO>>(
                    RestCall.PostHttp(
                           URL.接口url1 + "/mrp_report/getRetailStockOutByBarcodes",
                           FunctionHelper.JsonSerialization(barcodes)
                           )
                );
        }
        /// <summary>
        /// 保存键值对
        /// </summary>
        /// <param name="douyinStockOutDTOs"></param>
        /// <returns></returns>
        public static Dictionary<String, int> addDictionary(List<DouyinStockOutDTO> douyinStockOutDTOs)
        {
            Dictionary<String, int> keyValuePairs = new Dictionary<string, int>();
            foreach (DouyinStockOutDTO douyinStockOutDTO in douyinStockOutDTOs)
            {
                //key存在时，value+1
                if (keyValuePairs.ContainsKey(douyinStockOutDTO.styleNameCn + douyinStockOutDTO.materialCode))
                {
                    keyValuePairs[douyinStockOutDTO.styleNameCn + douyinStockOutDTO.materialCode] += 1;
                }
                //key不存在时，创建键值对
                else
                {
                    keyValuePairs.Add(douyinStockOutDTO.styleNameCn + douyinStockOutDTO.materialCode, 1);
                }
            }
            return keyValuePairs;
        }
        /// <summary>
        /// 取抖音sku一览
        /// </summary>
        /// <returns></returns>
        public static List<DouyinSkuDao> getDouyinSKU()
        {
            return
                FunctionHelper.JsonDeserialization<List<DouyinSkuDao>>(
                    RestCall.httpGetMethod(
                        URL.接口url1 + "/douyin/getDouyinSKU"
                    )
                );
        }
        /// <summary>
        /// csv导入抖音sku
        /// </summary>
        /// <param name="filePath"></param>
        /// <returns></returns>
        public static String saveDouyinSku(String filePath)
        {
            return
                FileService.UploadRequest(
                    URL.接口url1 + "/douyin/saveDouyinSku",
                    filePath,
                    Path.GetFileName(filePath),
                    "multipartFile"
                );
        }
        /// <summary>
        /// 保存sku参考码
        /// </summary>
        /// <param name="skuId"></param>
        /// <param name="barcode"></param>
        /// <returns></returns>
        public static DouyinSkuDao saveSkuCode(String skuId, String barcode)
        {
            return
                FunctionHelper.JsonDeserialization<DouyinSkuDao>(
                    RestCall.httpGetMethod(
                        URL.接口url1 + "/douyin/saveSkuCode?skuId=" + skuId
                        + "&barcode=" + barcode
                        )
                    );
        }

        /// <summary>
        /// 更新sku尺码
        /// </summary>
        /// <param name="skuId"></param>
        /// <param name="styleSizeCd"></param>
        /// <returns></returns>
        public static DouyinSkuDao updaetSkuStyleSizeCd(String skuId, String styleSizeCd)
        {
            return
                FunctionHelper.JsonDeserialization<DouyinSkuDao>(
                    RestCall.httpGetMethod(
                        URL.接口url1 + "/douyin/updaetSkuStyleSizeCd?skuId=" + skuId
                        + "&styleSizeCd=" + styleSizeCd
                        )
                    );
        }

        public static List<DouyinOrderDTO> getDouyinOrderAll1(int page, int size)
        {
            return
                FunctionHelper.JsonDeserialization<List<DouyinOrderDTO>>(
                    RestCall.httpGetMethod(
                        URL.接口url1 + "/douyin/getDouyinOrderAll?page=" + page
                        + "&size=" + size
                    )
                );
        }

        /// <summary>
        /// 根据客户电话取客户订单
        /// </summary>
        /// <param name="mobile"></param>
        /// <returns></returns>
        public static DouyinCustomerOrderInfoDTO getOrderInfoByMobile(String mobile)
        {
            return
                FunctionHelper.JsonDeserialization<DouyinCustomerOrderInfoDTO>(
                    RestCall.httpGetMethod(
                        URL.接口url1 + "/douyin/getOrderInfoByMobile?mobile=" + mobile
                    )
                );
        }
    }
    //抖音订单需求dto
    public class DouyinRequestDTO
    {
        public String materialRequirementId { get; set; }
        public String refBarcode { get; set; } //样衣barcode
        public String styleNameCn { get; set; } //款式名称
        public String materialCode { get; set; } //面料号
        public String styleSizeCd { get; set; } //尺码
        public double price { get; set; } //售价
        public int requestQuantity { get; set; } //需求数量
        public Boolean complete { get; set; } //是否完成
        public int stockOutQuantity { get; set; } //已发运数量
        public List<DouyinStockOutDetailDTO> douyinStockOutDetailDTOs { get; set; } = new List<DouyinStockOutDetailDTO>(); //抖音已发运明细
        public DouyinRequestDTO()
        {

        }

        public DouyinRequestDTO(string refBarcode, string styleNameCn, string materialCode)
        {
            this.refBarcode = refBarcode;
            this.styleNameCn = styleNameCn;
            this.materialCode = materialCode;
        }
        public DouyinRequestDTO build(int requestQuantity, double price)
        {
            this.requestQuantity = requestQuantity;
            this.price = price;
            return this;
        }
    }

    //抖音已发运dto
    public class DouyinStockOutDetailDTO
    {
        public String barcode { get; set; } //成衣条码
        public String styleNameCn { get; set; } //款式名称
        public String materialCode { get; set; } //面料号
        public String styleSizeCd { get; set; } //尺码

        public DouyinStockOutDetailDTO()
        {

        }

        public DouyinStockOutDetailDTO(string barcode, string styleNameCn, string materialCode, string styleSizeCd)
        {
            this.barcode = barcode;
            this.styleNameCn = styleNameCn;
            this.materialCode = materialCode;
            this.styleSizeCd = styleSizeCd;
        }
    }
    public class DouyinMaterialDTO
    {
        public String refBarcode { get; set; } //参考成衣码
        public String styleNameCn { get; set; } //款式名称
        public String materialCode { get; set; } //面料号
        public String styleSizeCd { get; set; } //尺码
        public DouyinMaterialDTO()
        {

        }

        public DouyinMaterialDTO(string refBarcode, string styleNameCn, string materialCode, string styleSizeCd)
        {
            this.refBarcode = refBarcode;
            this.styleNameCn = styleNameCn;
            this.materialCode = materialCode;
            this.styleSizeCd = styleSizeCd;
        }
    }
    public class DouyinReportDetailDTO
    {
        public String barcode { get; set; } //成衣条码
        public String styleNameCn { get; set; } //款式名称
        public String materialCode { get; set; } //面料号
        public String styleSizeCd { get; set; } //尺码
        public double price { get; set; } //售价
        public int requestQuantity { get; set; } //需求数量
        public int stockOutQuantity { get; set; } //已发运数量



        public DouyinReportDetailDTO()
        {

        }

        public DouyinReportDetailDTO(string barcode, string styleNameCn, string materialCode, string styleSizeCd)
        {
            this.barcode = barcode;
            this.styleNameCn = styleNameCn;
            this.materialCode = materialCode;
            this.styleSizeCd = styleSizeCd;
        }
        public DouyinReportDetailDTO build(double price, int requestQuantity, int stockOutQuantity)
        {

            this.price = price;
            this.requestQuantity = requestQuantity;
            this.stockOutQuantity = stockOutQuantity;
            return this;
        }
    }
    public class DouyinStockOutDTO
    {
        public String styleNameCn { get; set; } //款式名称
        public String materialCode { get; set; } //面料号
        public double price { get; set; } //售价
        public int requestQuantity { get; set; } //需求数量
        public String dateStamp { get; set; }
        public int stockOutQuantity { get; set; } //已发运数量
        public List<DouyinStockOutQueryDTO> douyinStockOutQueryDTOList { get; set; } = new List<DouyinStockOutQueryDTO>();
        public DouyinStockOutDTO()
        {

        }
        public DouyinStockOutDTO build(int stockOutQuantity)
        {
            this.stockOutQuantity = stockOutQuantity;
            return this;
        }
    }
    public class DouyinStockOutQueryDTO
    {
        public String barcode { get; set; } //成衣条码
        public String styleNameCn { get; set; } //款式名称
        public String materialCode { get; set; } //面料号
        public String styleSizeCd { get; set; } //尺码
        public double price { get; set; } //售价
        public int requestQuantity { get; set; } //需求数量
        public DateTime createDate { get; set; }
        public DouyinStockOutQueryDTO()
        {

        }
    }
    public class RetailStockOutDTO
    {
        public String barcode { get; set; } //成衣条码
        public String styleNameCn { get; set; } //款式名称
        public String materialCode { get; set; } //面料号
        public String styleSizeCd { get; set; } //尺码
        public Double price { get; set; }
        public RetailStockOutDTO()
        {

        }
    }
    public class DouyinSkuDao
    {
        public String skuId { get; set; }  //规格ID(SKUID)
        public String productId { get; set; }   //商品ID
        public String productName { get; set; }//商品名称
                                               //一级类目
                                               //二级类目
                                               //三级类目
                                               //四级类目
                                               //商品类型
                                               //商品分组
                                               //商家编码
                                               //商品规格
        public String spec { get; set; }   //  规格
        public String size { get; set; }   //  显示尺码
        public String styleSizeCd { get; set; }//  尺码
                                               //商品发货时间
                                               //商品价格
                                               //现货库存
                                               //预售库存
                                               //阶梯库存
                                               //销量
                                               //佣金比例
                                               //商品审核状态
        public String url { get; set; }//商品链接
        public DateTime createDate { get; set; }

        public String barcode { get; set; }
        public String styleCode { get; set; }
        public String materialCode { get; set; }
        public DouyinSkuDao()
        {

        }
    }
    public class DouyinOrderDTO
    {
        public String subOrderNo { get; set; }  // 子订单编号 " 4873777077591317897"
        public String orderNo { get; set; } // 主订单编号 " 4873777077591317897"
        public String inventoryNo { get; set; } // 选购商品 " 【春衫定制】纯色大圆领绸丽绒打底衫保暖吊带背心女21F69"
        public String spec { get; set; }    // 商品规格 " 白色1950_01{get;set;}2XL（140~150斤）"
        public int quantity { get; set; }   // 商品数量 2
        public String productId { get; set; }   // 商品ID " 3512236491768224471"
        public String shopNo { get; set; }  // 商家编码
        public Double unitPrice { get; set; }   // 商品单价 69
        public Double payable { get; set; } // 订单应付金额 99
        public Double deliveryPrice { get; set; }   // 运费 0
        public Double discount { get; set; }    // 优惠总金额 39.04
        public Double platformDiscount { get; set; }    // 平台优惠 -
        public String shopDicountDesc { get; set; } // 商家优惠 两件99-39.00
        public String broadcastDicountDesc { get; set; }    // 主播优惠 -
        public Double shoPriceModify { get; set; }  // 商家改价 0
        public Double paymentDiscount { get; set; } // 支付优惠 0.04
        public Double hongbaoDiscount { get; set; } // 红包抵扣 0
        public String paymentType { get; set; } // 支付方式 " 银行卡"
        public Double commission { get; set; }   // 手续费 0
        public String reception { get; set; }   // 收件人 ##XYjykxjZJ9l0yb2IlQWj9ZAhJt2/wXHLNE/BStdE4hhe7369DK6E9kVhCkfDXkla2iWPNWuVt+VY+1Cn3if1bbFedg/oCFYC4N3F*CgkIARCtHCABKAESPgo8mgBetVteQKwns8g3UGaHwrXHe4fl68XdYV4+vlzWgaSK2vbRa5abL7/x4YEElRb5VRL3bgxQUk/5zPlZGgA=#1##
        public String mobile { get; set; }  // 收件人手机号 ##MA0H4Y4/lMuDc64N9mwc3f9zY40TY7NeIUwgblnA3EUQbeSeh+PWtaz0oRNWp3E0qYL3z4V25NdUT9+Z3LHc3UmQ21r+5f9/a1GQkRc=*CgkIARCtHCABKAESPgo8ttVBfFY2naf5ypMRM9Q88gDX4v1bsP7E9jhH2D3zmhbZxLthAHLVE0pC6SRo3wyqq4YRtxWlMw+FMKykGgA=#1##
        public String province { get; set; }    // 省 北京市
        public String city { get; set; }    // 市 北京市
        public String county { get; set; }  // 区 东城区
        public String district { get; set; }    // 街道 崇文门外街道
        public String addressDetail { get; set; }   // 详细地址 ##e8zXa52KkqWmspQFdyhI5VG/ZrdyQgDygU2qLpfOTbni90iNKVqBbjTCQQygDNlzALt0Qlu1DnoklRxYwKbal0lgU8lItd0C3Szuz2l7IdWq2c+vTsAw4Wwjsy9gCgIHgX8=*CgkIARCtHCABKAESPgo8u6oRux4rQmHhMXiDilcJFYoL+WCtobpmaxXehCtWHIQnR/7q64qbJkFWY0e5H+Nv4HACnVJHrCGGp7KaGgA=#1##
        public String addressModify { get; set; }   // 是否修改过地址 否
        public String buyer { get; set; }   // 买家留言
        public DateTime orderDate { get; set; }   // 订单提交时间 " 2021-12-07 14:49:39"
        public String flagColor { get; set; }   // 旗帜颜色 灰色
        public String shopMemo { get; set; }    // 商家备注
        public DateTime orderCompleteDate { get; set; }// 订单完成时间
        public DateTime paymentDate { get; set; }   // 支付完成时间 " 2021-12-07 14:49:49"
        public String appChannel { get; set; }  // APP渠道 抖音极速版
        public String trafficSource { get; set; }   // 流量来源 小店自卖
        public String orderStatus { get; set; } // 订单状态 备货中
        public DateTime arrivalDate { get; set; }   // 承诺发货时间 " 2021-12-16 21:53:34"
        public String orderType { get; set; }   // 订单类型 普通订单
        public String lubanPageId { get; set; } // 鲁班落地页ID " 0"
        public String wiseManId { get; set; }   // 达人ID " 0"
        public String wiseManName { get; set; } // 达人昵称
        public String shopId { get; set; }   // 所属门店ID -
        public String postSaleStatus { get; set; }  // 售后状态 -
        public String cancelReason { get; set; }    // 取消原因
        public DateTime preDeliveryDate { get; set; }   // 预约发货时间 -
        public String stockId { get; set; } // 仓库ID " -"
        public String stockName { get; set; }   // 仓库名称 " -"
        public String anxin { get; set; }   // 是否安心购 是
        public String advertisingChannel { get; set; }  // 广告渠道 无
        public String deliveryHost { get; set; }    // 发货主体 -
        public String deliveryHostDetail { get; set; }  // 发货主体明细 -

        /*
         *  sku数据
         */
        public String skuId { get; set; }   //规格ID(SKUID)
        public String barcode { get; set; }

        public String styleSizeCd { get; set; } //  尺码
        public String styleCode { get; set; }
        public String materialCode { get; set; }

        public String status { get; set; }  //  抖音下单状态  @see top.toptimus.constValue.DouyinStatusConst
        public DouyinOrderDTO()
        {

        }
    }
    public class DouyinMakingDTO
    {
        public String styleNameCn { get; set; } //款式名称
        public String materialCode { get; set; } //面料号
        public String styleSizeCd { get; set; } //尺码
        public int makingQuantity { get; set; } //在制品数量
        public int stockInQuantity { get; set; } //生产入库数量
        public int stockOutQuantity { get; set; } //出库数量

        public DouyinMakingDTO()
        {

        }

        public DouyinMakingDTO(string styleNameCn, string materialCode, string styleSizeCd, int makingQuantity, int stockInQuantity, int stockOutQuantity)
        {
            this.styleNameCn = styleNameCn;
            this.materialCode = materialCode;
            this.styleSizeCd = styleSizeCd;
            this.makingQuantity = makingQuantity;
            this.stockInQuantity = stockInQuantity;
            this.stockOutQuantity = stockOutQuantity;
        }
    }
    public class DouyinPrepareDTO
    {
        public String styleNameCn { get; set; } //款式名称
        public String materialCode { get; set; } //面料号
        public String styleSizeCd { get; set; } //尺码
        public int requestQuantity { get; set; } //生产入库数量
        public int shippedQuantity { get; set; } //出库数量
        public int finishQuantity { get; set; } //在制品数量
        public int saleQuantity { get; set; } //生产入库数量
        public int stockQuantity { get; set; } //生产入库数量
        public int orderQuantity { get; set; } //出库数量
        public int makingQuantity { get; set; } //在制品数量
        public int stockInQuantity { get; set; } //生产入库数量
        public int stockOutQuantity { get; set; } //出库数量
        public DouyinPrepareDTO()
        {

        }
        public DouyinPrepareDTO(string styleNameCn, string materialCode, string styleSizeCd, int requestQuantity, int shippedQuantity, int finishQuantity, int saleQuantity, int stockQuantity, int orderQuantity, int makingQuantity, int stockInQuantity, int stockOutQuantity)
        {
            this.styleNameCn = styleNameCn;
            this.materialCode = materialCode;
            this.styleSizeCd = styleSizeCd;
            this.requestQuantity = requestQuantity;
            this.shippedQuantity = shippedQuantity;
            this.finishQuantity = finishQuantity;
            this.saleQuantity = saleQuantity;
            this.stockQuantity = stockQuantity;
            this.orderQuantity = orderQuantity;
            this.makingQuantity = makingQuantity;
            this.stockInQuantity = stockInQuantity;
            this.stockOutQuantity = stockOutQuantity;
        }
    }
    public class DouyinProcedureDTO
    {
        public String barcode { get; set; } //款式名称
        public String procedureName { get; set; } //尺码
        public String batchNo { get; set; } //面料号
        public String firstType { get; set; } //款式名称
        public String firstTime { get; set; } //尺码
        public String latestType { get; set; } //款式名称
        public String latestTime { get; set; } //尺码
        public DouyinProcedureDTO()
        {

        }

        public DouyinProcedureDTO(string barcode, string procedureName, string batchNo, string firstType, string firstTime, string latestType, string latestTime)
        {
            this.barcode = barcode;
            this.procedureName = procedureName;
            this.batchNo = batchNo;
            this.firstType = firstType;
            this.firstTime = firstTime;
            this.latestType = latestType;
            this.latestTime = latestTime;
        }
    }

    public class DouyinCustomerOrderInfoDTO
    {
        public DouyinAddressQueryDTO douyinAddressQueryDTO { get; set; } = new DouyinAddressQueryDTO();
        public List<DouyinCustomerOrderRelateInfoDTO> douyinCustomerOrderRelateInfoDTOList { get; set; } = new List<DouyinCustomerOrderRelateInfoDTO>();
        public DouyinCustomerOrderInfoDTO()
        {

        }
    }
    public class DouyinCustomerOrderRelateInfoDTO
    {
        /**
         * 订单信息
         */
        public String subOrderNo { get; set; }  //  子订单编号   "   4873777077591317897"
        public String orderNo { get; set; } //  主订单编号   "   4873777077591317897"
        public String inventoryNo { get; set; } //  选购商品    "   【春衫定制】纯色大圆领绸丽绒打底衫保暖吊带背心女21F69"
        public String spec { get; set; }    //  商品规格    "   白色1950_01{get;set;}2XL（140~150斤）"
                                            //  订单维度和度量数据
        public int quantity { get; set; }   //  商品数量    2
        public Double unitPrice { get; set; }   //  商品单价    69
        public Double payable { get; set; } //  订单应付金额  99
        public Double deliveryPrice { get; set; }   //  运费  0
        public Double discount { get; set; }    //  优惠总金额   39.04
        public Double platformDiscount { get; set; }    //  平台优惠    -
        public String shopDicountDesc { get; set; } //  商家优惠    两件99-39.00
        public String broadcastDicountDesc { get; set; }    //  主播优惠    -
        public Double shoPriceModify { get; set; }  //  商家改价    0
        public Double paymentDiscount { get; set; } //  支付优惠    0.04
        public Double hongbaoDiscount { get; set; } //  红包抵扣    0
        public String paymentType { get; set; } //  支付方式    "   银行卡"
        public Double commission { get; set; }   // 手续费 0
                                                 //  sku数据
        public String styleSizeCd { get; set; } //  尺码
        public String styleCode { get; set; }
        public String materialCode { get; set; }
        public DateTime createDate { get; set; }
        //
        public String buyer { get; set; }   //  买家留言
        public DateTime orderDate { get; set; }   //    订单提交时间  "   2021-12-07 14:49:39"
        public String shopMemo { get; set; }    //  商家备注
        public DateTime orderCompleteDate { get; set; }//   订单完成时间
        public DateTime paymentDate { get; set; }   //  支付完成时间  "   2021-12-07 14:49:49"
        public String orderStatus { get; set; } //  订单状态    备货中
        public DateTime arrivalDate { get; set; }   //  承诺发货时间  "   2021-12-16 21:53:34"
        public String postSaleStatus { get; set; }  //  售后状态    -
        public String cancelReason { get; set; }    //  取消原因
        /**
         * 运单信息
         */
        public String logisticsOrderNo { get; set; }   //   运单号
        public DateTime deliveryTime { get; set; }   //   发货时间
        public String deliveryCorp { get; set; }   //   快递公司
        public String packageStatus { get; set; }   //   包裹状态
        public String exceptionType { get; set; }   //   异常类型
        public String exceptionDescription { get; set; }   //   异常说明
        public String exceptionStatus { get; set; }   //   异常状态
        public String logisticsRemarks { get; set; }   //   运单备注
        public String processingStatus { get; set; }   //   处理状态
        public DateTime pickupTime { get; set; }   //   揽件时间
        public DateTime signingTime { get; set; }   //   签收时间
        /**
         * 退货运单信息
         */
        public String returnLogisticsOrderNo { get; set; }   //   运单号
        public DateTime returnTime { get; set; }   //   退货时间
        public String returnDeliveryCorp { get; set; }   //   快递公司
        public String returnPackageStatus { get; set; }   //   包裹状态
        public String returnCurrentexceptiontype { get; set; }   //   当前异常类型
        public String returnExceptionDescription { get; set; }   //   异常说明
        public String returnLogisticsRemarks { get; set; }   //   运单备注
        public String returnProcessingStatus { get; set; }   //   处理状态

        public DouyinCustomerOrderRelateInfoDTO()
        {

        }
    }
    public class DouyinAddressQueryDTO
    {
        public String mobile { get; set; }
        public String customerName { get; set; }
        public String addressProvince { get; set; } //  省
        public String addressCity { get; set; } //  市
        public String addressDistrict { get; set; } //  区
        public String addressStreet { get; set; }   //  街道
        public String addressDetail { get; set; }// 详细地址
        public Boolean approval { get; set; }   //  是否核准
        public DateTime createDate { get; set; }
        public DateTime approvalDate { get; set; }  //  核准日期
        public String orgId { get; set; }   //  来源组织id，也就是获客渠道
        public String shopId { get; set; }  //  来源组织id，也就是获客渠道
        public String addressNumber { get; set; } // 门牌号、详细地址
        public String level { get; set; } // 兴趣点、街道等
        public String location { get; set; } // 定位
        public DouyinAddressQueryDTO()
        {

        }
    }
    public class DouyinCustomerAddressDTO
    {
        public String customerName { get; set; }
        public String mobile { get; set; }
        public String addressProvince { get; set; } //  省
        public String addressCity { get; set; } //  市
        public String addressDistrict { get; set; } //  区
        public String formattedAddress { get; set; }   //  高德返回地址
        public String addressNumber { get; set; }// 门牌/详细地址
        public String location { get; set; }
        public String level { get; set; }
        public DouyinCustomerAddressDTO(
            string customerName,
            string mobile,
            string addressProvince,
            string addressCity,
            string addressDistrict,
            string formattedAddress,
            string addressNumber,
            string location,
            string level
            )
        {
            this.customerName = customerName;
            this.mobile = mobile;
            this.addressProvince = addressProvince;
            this.addressCity = addressCity;
            this.addressDistrict = addressDistrict;
            this.formattedAddress = formattedAddress;
            this.addressNumber = addressNumber;
            this.location = location;
            this.level = level;
        }
    }

    public class DouyinCustomerAddressDao
    {
        public String userId { get; set; }
        public String mobile { get; set; }
        public String customerName { get; set; }
        public String addressProvince { get; set; } //  省
        public String addressCity { get; set; } //  市
        public String addressDistrict { get; set; } //  区
        public String formattedAddress { get; set; }// 地址
        public String addressNumber { get; set; }// 门牌号、详细地址
        public String level { get; set; }// 兴趣点、街道等
        public String location { get; set; }// 定位
        public DateTime createDate { get; set; }
        public DouyinCustomerAddressDao()
        {

        }
    }
}
